package com.situ.mall.common.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.situ.mall.common.entity.OrderInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 订单主表 Mapper 接口
 * </p>
 *
 * @author 闫佳宁
 * @since 2023-09-22
 */
public interface OrderInfoMapper extends BaseMapper<OrderInfo> {


    List selectOrder(@Param("username") String username, @Param("status1") String status);

    List orderDetail(Integer id);

    @Update("update order_info set status='待收货',status1 = 1 where id=#{id}")
    void update1(Integer id);



    @Select("select * from order_info where id = #{id}")
    List<OrderInfo> selectOrderInfo(Integer id);

    @Update("update order_info set status = '已支付' where code=#{code}")
    void paySuccess(String code);

    @Update("update order_info set status = '已签收',status1 = -1 where id = #{id}")
    void confirm(Integer id);
}
